#ifndef _INPUT_H_
#define _INPUT_H_

#include <dinput.h>
#include "vector"

#define KEYBOARD_BUFFER_SIZE	1024

#define ISKEYDOWN(keystatus) (keystatus & 0x80)

using namespace std;

enum States
{
	KEY_PRESS = 0,
	KEY_RELEASE,
	KEY_UP,
	KEY_DOWN,
	NUMBER_OF_STATES
};

struct StateOfKey
{
	int KeyCode;
	States KeyStates;
};

class CInput
{
private:
	HINSTANCE				hInstance_;
	HWND					hWnd_;

	LPDIRECTINPUT8			dInput_; 
	LPDIRECTINPUTDEVICE8	Keyboard_;
	BYTE					KeyStates_[256];
	BYTE					PreKeyStates_[256];
	DIDEVICEOBJECTDATA		_KeyEvents[KEYBOARD_BUFFER_SIZE];

	//bool					pressedKey_[KEYBOARD_BUFFER_SIZE];
public:
	CInput(HINSTANCE hInstance,HWND hWnd);
	~CInput(void);

	void Update();

	bool KeyPress(int KeyCode);
	bool KeyDown(int KeyCode);
	bool KeyUp(int KeyCode);
	bool KeyRelease(int KeyCode);

};
#endif
